﻿<CC:AnimatedBasePage
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
	xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
	xmlns:CC="clr-namespace:Clarity.Phone.Controls"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit" 
	xmlns:ic="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions" 
	x:Class="TradeMo.SearchResultsView"
	SupportedOrientations="Portrait" Orientation="Portrait"
	mc:Ignorable="d" d:DesignHeight="800" d:DesignWidth="480"
	d:DataContext="{d:DesignData SampleData/SearchResultsViewSampleData.xaml}"
	FontFamily="{StaticResource PhoneFontFamilyNormal}" FontSize="{StaticResource PhoneFontSizeNormal}" Foreground="{StaticResource PhoneForegroundBrush}"
	>

	<!--LayoutRoot is the root grid where all page content is placed-->
	<Grid x:Name="LayoutRoot" >
		<Grid.Projection>
			<PlaneProjection/>
		</Grid.Projection>
		<VisualStateManager.VisualStateGroups>
			<VisualStateGroup x:Name="EnabledGroup" ic:ExtendedVisualStateManager.UseFluidLayout="True">
				<VisualStateGroup.Transitions>
					<VisualTransition GeneratedDuration="0:0:0.3"/>
				</VisualStateGroup.Transitions>
				<VisualState x:Name="EnabledState"/>
				<VisualState x:Name="DisabledState">
					<Storyboard>
						<DoubleAnimation Duration="0" To="-45" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.GlobalOffsetZ)" Storyboard.TargetName="LayoutRoot" d:IsOptimized="True"/>
						<DoubleAnimation Duration="0" To="0.4" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="LayoutRoot" d:IsOptimized="True"/>
					</Storyboard>
				</VisualState>
			</VisualStateGroup>
		</VisualStateManager.VisualStateGroups>
		<Grid.Background>
			<ImageBrush ImageSource="/Wallpaper2.jpg" Stretch="None" Opacity="0.595"/>
		</Grid.Background>
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="*"/>
		</Grid.RowDefinitions>
		
		<VisualStateManager.CustomVisualStateManager>
			<ic:ExtendedVisualStateManager/>
		</VisualStateManager.CustomVisualStateManager>
		<TextBlock HorizontalAlignment="Center" Grid.Row="0" TextWrapping="Wrap" Text="{Binding SearchString}" VerticalAlignment="Center" Style="{StaticResource PhoneTextLargeStyle}"/>
		<ProgressBar Height="10" VerticalAlignment="Top" IsIndeterminate="{Binding IsSearching}" Style="{StaticResource TradeMoProgressBarStyle}" Grid.Row="0" Margin="0,62,0,0"/>
		<Button x:Name="SearchTypeButton" Grid.Row="0" Padding="0" FontFamily="Segoe WP Light" FontSize="12" VerticalContentAlignment="Bottom" Style="{StaticResource NoBorderButtonStyle}" BorderBrush="{x:Null}" HorizontalAlignment="Right" VerticalAlignment="Center" >
			<toolkit:GestureService.GestureListener>
				<toolkit:GestureListener Hold="GestureListener_Hold" Tap="GestureListener_Tap" />
			</toolkit:GestureService.GestureListener>
			<Grid Height="48" Background="White">
				<Image Source="{Binding SearchTypeImage, Mode=OneWay}" />
				<TextBlock Text="{Binding SearchTypeName, Mode=OneWay}" VerticalAlignment="Bottom" HorizontalAlignment="Center" >
					<TextBlock.Foreground>
						<SolidColorBrush Color="{StaticResource PhoneAccentColor}"/>
					</TextBlock.Foreground>
				</TextBlock>
			</Grid>
		</Button>
		
		<Grid Grid.Row="1">
			<Grid.RowDefinitions>
				<RowDefinition Height="Auto"/>
				<RowDefinition Height="Auto"/>
				<RowDefinition/>
			</Grid.RowDefinitions>
			<TextBlock Grid.Row="0" x:Name="TotalCountText" HorizontalAlignment="Right" Text="{Binding TotalCount, Mode=OneWay}" Style="{StaticResource PhoneTextSubtleStyle}" FontSize="13.333" Foreground="#66FFFFFF" />
			<TextBlock x:Name="DidYouMeanText" Grid.Row="1" Text="{Binding DidYouMean}" Style="{StaticResource PhoneTextBlockBase}" Visibility="{Binding ShowDidYouMean, Converter={StaticResource VisibilityConverter}, Mode=OneWay}" MouseLeftButtonDown="DidYouMeanText_MouseLeftButtonDown" Foreground="White" />
					
			<ListBox x:Name="ResultsListBox" Grid.Row="2" 
				ItemsSource="{Binding SearchResults}" 
				ItemTemplate="{StaticResource ListingDataTemplate}" 
				ItemContainerStyle="{StaticResource SearchResultsListBoxItemStyle}" 
				SelectionChanged="ResultsListBox_SelectionChanged" />
		</Grid>

	</Grid>
 
</CC:AnimatedBasePage>
